package cn.dapeng;

public class SonRelation {


    public static void main(String[] args) {

        C c = new C();
        System.out.println(c.getClass().isAssignableFrom(B.class));
        System.out.println(c.getClass().isAssignableFrom(A.class));
        System.out.println(" ----- ");

        System.out.println(A.class.isAssignableFrom(C.class));
        System.out.println(B.class.isAssignableFrom(C.class));

        System.out.println(" ----- ");

        System.out.println(Object.class.isAssignableFrom(C.class));

        System.out.println(Integer.class.isAssignableFrom(C.class));
    }
}


interface A {

    void init();

}


class B implements A {

    @Override
    public void init() {
        System.out.println("init call");
    }
}

class C extends B {

    public void say() {
        System.out.println(" say hi ......");
    }
}